<script language="javascript">
    
    // insert the form html code
    function insertFormWizzard() {
                
            html = insertDatabaseForm();

            if (ifCkeditor()) {
                //insertText(html);
//                alert(html);
                CKEDITOR.instances.ckeditor_id.insertHtml(html);
//                CKEDITOR.instances.ckeditor_id.insertText(html);

                
                
            } else {
                $("#editor").append(html);     
            }

            
            $('#dialogBox').dialog('close');  
        
    }
    
    
    
</script>

    <form action="" method="post" name="insertForm" id="insertForm">
      <p>Tabelle<br />
<select name="tableFormular" id="tableFormular"  onchange="refreshData('/code/ajax/wizzard_tablefield.php?t='+$('#tableFormular').val(),'wizzard_tablefield');" table_list="">
    <option value="[table]">[table]</option>
        </select>
      </p>
      <div ajax="true" name="wizzard_tablefield" id="wizzard_tablefield">
      <div  ifexist="[parameter:t]">
      
 <ul table_field_list="[get:t]"> 
      <li>
                <label>
            <input type="checkbox" name="checkbox_[field]" id="checkbox_[field]" value="[field]" /> 
            [field]</label>
                
                ***
                <select name="type_[field]" id="type_[field]">
                  <option value="1">Input Feld</option>
                  <option value="2">Hidden Input Feld</option>
                  <option value="3">File Input</option>
                  <option value="4">Select Auswahlbox</option>
                  <option value="5">Checkbox</option>
                  <option value="6">Text Editor</option>
                  <option value="7">Wyswig Editor (klein)</option>
                  
                  <option value="9">Input Feld mit Date Picker</option>
                </select>
                ***
                
                <select name="check_[field]" id="check_[field]">
                  <option value="0">kein Check</option>
                  <option value="1">ist Wert vorhanden</option>
                  <option value="2">g&uuml;ltige Zahl</option>
                  <option value="3">g&uuml;ltige eMail Adresse</option>
                  <option value="4">g&uuml;ltiges Passwort (min. 6 Zeichen)</option>
                  <option value="5">ist Wert bereits in der Tabelle vorhanden</option>
                  
                </select>
      </li>
</ul>
      
      
      <p>
        <label>
          <input type="checkbox" name="checkbox" id="checkbox" />
          Focus auf erstem Element</label>
      </p>
      <p>Redirect<br />
  <label>
    <select name="listRedirect" id="listRedirect">
      <option value=""></option>
      
      <data table="page" orderby="titel">
        <option value="[_url]">[titel]</option>
        </data>
      </select>
  </label>
      </p>
      
            <p>Mail<br />
<label>
  <select name="listMail" id="listMail">
            <option value=""></option>
            
            <data  table="_mail" orderby="filename">
            <option value="[filename]">[filename]</option>
            </data>
  </select>
        </label>
      </p>
      
      <p>
        <label>
          <input type="button" name="button" id="button" value="Formular einf&uuml;gen" onClick="insertFormWizzard();">
        </label>
      </p>
    </form>
